package com.example.config;

import com.example.properties.JwtProperties;
import com.example.utils.JwtUtil;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class JwtConfig {

    /**
     * 创建JwtUtil
     *
     * @param jwtProperties
     * @return
     */
    @Bean
    public JwtUtil jwtUtil(JwtProperties jwtProperties) {
        return new JwtUtil(jwtProperties.getSecret(), jwtProperties.getIssuer(), jwtProperties.getExpireMinutes());
    }

}
